package com.hunsy.d2d.mqtt.netty.handler.http;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.mqtt.MqttDecoder;
import io.netty.handler.codec.mqtt.MqttEncoder;

/**
 * HTTP
 * Created by hunsy on 2017/5/3.
 */
public class HttpInitializer extends ChannelInitializer<NioServerSocketChannel> {

    protected void initChannel(NioServerSocketChannel ch) throws Exception {

        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast(new MqttDecoder());
        pipeline.addLast(new MqttEncoder());
    }
}
